package com.ean.backpack.domain;

import java.io.Serializable;
import java.util.Calendar;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.format.annotation.DateTimeFormat;

@Entity
@Table(name = "roomtypelist")
public class Roomtypelist implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2288591346811678760L;

	@EmbeddedId
	private RoomtypelistPK id;

	public RoomtypelistPK getId() {
		return this.id;
	}

	public void setId(RoomtypelistPK id) {
		this.id = id;
	}

	@Column(name = "LanguageCode", length = 5)
	private String languageCode;

	@Column(name = "RoomTypeImage", length = 256)
	private String roomTypeImage;

	@Column(name = "RoomTypeName", length = 200)
	private String roomTypeName;

	@Column(name = "RoomTypeDescription")
	private String roomTypeDescription;

	@Column(name = "TimeStamp")
	@NotNull
	@Temporal(TemporalType.TIMESTAMP)
	@DateTimeFormat(style = "MM")
	private Calendar timeStamp;

	public String getLanguageCode() {
		return languageCode;
	}

	public void setLanguageCode(String languageCode) {
		this.languageCode = languageCode;
	}

	public String getRoomTypeImage() {
		return roomTypeImage;
	}

	public void setRoomTypeImage(String roomTypeImage) {
	}

	public String getRoomTypeName() {
		return roomTypeName;
	}

	public void setRoomTypeName(String roomTypeName) {
	}

	public String getRoomTypeDescription() {
		return roomTypeDescription;
	}

	public void setRoomTypeDescription(String roomTypeDescription) {
	}

	public Calendar getTimeStamp() {
		return timeStamp;
	}

	public void setTimeStamp(Calendar timeStamp) {
		this.timeStamp = timeStamp;
	}

	@Override
	public String toString() {
		return ReflectionToStringBuilder.toString(this,
				ToStringStyle.SHORT_PREFIX_STYLE);
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result
				+ ((languageCode == null) ? 0 : languageCode.hashCode());
		result = prime
				* result
				+ ((roomTypeDescription == null) ? 0 : roomTypeDescription
						.hashCode());
		result = prime * result
				+ ((roomTypeImage == null) ? 0 : roomTypeImage.hashCode());
		result = prime * result
				+ ((roomTypeName == null) ? 0 : roomTypeName.hashCode());
		result = prime * result
				+ ((timeStamp == null) ? 0 : timeStamp.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Roomtypelist other = (Roomtypelist) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (languageCode == null) {
			if (other.languageCode != null)
				return false;
		} else if (!languageCode.equals(other.languageCode))
			return false;
		if (roomTypeDescription == null) {
			if (other.roomTypeDescription != null)
				return false;
		} else if (!roomTypeDescription.equals(other.roomTypeDescription))
			return false;
		if (roomTypeImage == null) {
			if (other.roomTypeImage != null)
				return false;
		} else if (!roomTypeImage.equals(other.roomTypeImage))
			return false;
		if (roomTypeName == null) {
			if (other.roomTypeName != null)
				return false;
		} else if (!roomTypeName.equals(other.roomTypeName))
			return false;
		if (timeStamp == null) {
			if (other.timeStamp != null)
				return false;
		} else if (!timeStamp.equals(other.timeStamp))
			return false;
		return true;
	}

}
